home *** CD-ROM | disk | FTP | other *** search
- From: Mike Brennan <brennan@boeing.com>
- Subject: v01i070: mawk - (Ver. 1.1) An interpreter for the AWK language, Patch01
- Newsgroups: comp.sources.reviewed
- Approved: csr@calvin.dgbt.doc.ca
-
- Submitted-by: Mike Brennan <brennan@boeing.com>
- Posting-number: Volume 1, Issue 70
- Archive-name: mawk/patch01
- Patch-To: mawk: Volume 1, Issue 50-68
-
- This is patch1 for mawk1.1.
- It updates mawk1.1 to mawk1.1.1
-
- Changes:
-
- 1) fixed bug which caused
-
- mawk 'program' var=value
-
- without files on the command line to sporadically fail.
-
- 2) fixed bug which caused
-
- getline <=
-
- to be mistaken for input redirection.
-
- 3) Changed rexp1.c to work around a bug in sun SC1.0 compiler.
-
- 4) Minor improvements to build_mawk script.
-
- 5) changed the name of ultrix42_mips.h to ultrix42mips.h so
- the filename is 14 characters.
-
- 6) printf() and sprintf() can now have more arguments than
- conversions in the format string. This allows a "poor man's" varargs
- functionality for user functions that do output.
-
- 7) new configurations:
-
- next, sgi, aix
-
- 8) removed HAVE_PRINTF_HD define as too obscure to be useful.
-
- 9) added missing config/apollo.h file.
-
-
- Directions:
-
- When you unshar the file below, you'll get two files:
- a /bin/sh script, apply1, and diffs1 to use with the patch program.
-
- Move both apply1 and diffs1 to your mawk1.1 directory and run
-
- /bin/sh apply1
-
-
-
- # This is a shell archive. Remove anything before this line,
- # then unpack it by saving it in a file and typing "sh file".
- #
- # Wrapped by mlssun12!brennan on Tue Mar 31 06:47:48 PST 1992
- # Contents: apply1 diffs1
-
- echo x - apply1
- sed 's/^@//' > "apply1" <<'@//E*O*F apply1//'
- #!/bin/sh
-
- # apply patch1 to mawk1.1
-
-
-
- # make sure there is not an existing ultrix42mips.h
- if [ -f config/ultrix42mips.h ]
- then
- mv config/ultrix42mips.h config/ultrix42.old
- fi
-
- patch -p < diffs1
-
- @//E*O*F apply1//
- chmod u=rwx,g=rx,o=rx apply1
-
- echo x - diffs1
- sed 's/^@//' > "diffs1" <<'@//E*O*F diffs1//'
- *** /tmp/,RCSt1a12419 Tue Mar 3 17:14:36 1992
- --- packing.list Tue Mar 3 16:34:25 1992
- ***************
- *** 1,6 ****
-
- ################################################
- ! # These files form the mawk distribution 1.1
- #
- # Mawk is an implementation of the AWK Programming Language as
- # defined and described in Aho, Kernighan and Weinberger, The
- --- 1,6 ----
-
- ################################################
- ! # These files form the mawk distribution 1.1.1
- #
- # Mawk is an implementation of the AWK Programming Language as
- # defined and described in Aho, Kernighan and Weinberger, The
- ***************
- *** 11,16 ****
- --- 11,17 ----
- packing.list this file
- README description of mawk 1.1
- NEW changes from 1.0 to 1.1
- + PATCHES changes from 1.1 to 1.1.1
- INSTALL installation instructions
- COPYING GNU General Public License, version 2
- ACKNOWLEDGMENT
- ***************
- *** 92,98 ****
- config/Idefault.h
- config/template.h
- config/ultrix_vax.h
- ! config/ultrix42_mips.h
- config/bsd43_vax.h
- config/sun_os40.h
- config/sun_os41.h
- --- 93,99 ----
- config/Idefault.h
- config/template.h
- config/ultrix_vax.h
- ! config/ultrix42mips.h
- config/bsd43_vax.h
- config/sun_os40.h
- config/sun_os41.h
- ***************
- *** 106,111 ****
- --- 107,115 ----
- config/dynix.h
- config/atarist.h
- config/mips.h
- + config/next.h
- + config/sgi.h
- + config/apollo.h
- #######################
- # directory: test testing and benchmarking directory
- test/mawktest scripts to test mawk compiled OK
- *** /dev/null Tue Mar 3 12:53:03 1992
- --- PATCHES Tue Mar 3 16:46:02 1992
- ***************
- *** 0 ****
- --- 1,34 ----
- +
- +
- + patch1: mawk1.1 to mawk1.1.1
- +
- + 1) fixed bug which caused
- +
- + mawk 'program' var=value
- +
- + without files on the command line to sporadically fail.
- +
- + 2) fixed bug which caused
- +
- + getline <=
- +
- + to be mistaken for input redirection.
- +
- + 3) Changed rexp1.c to work around a bug in sun SC1.0 compiler.
- +
- + 4) Minor improvements to build_mawk script.
- +
- + 5) changed the name of ultrix42_mips.h to ultrix42mips.h so
- + the filename is 14 characters.
- +
- + 6) printf() and sprintf() can now have more arguments than
- + conversions in the format string. This allows a "poor man's" varargs
- + functionality for user functions that do output.
- +
- + 7) new configurations:
- +
- + next, sgi, aix
- +
- + 8) removed HAVE_PRINTF_HD define as too obscure to be useful.
- +
- + 9) added missing config/apollo.h file.
- *** /tmp/,RCSt1a12423 Tue Mar 3 17:14:39 1992
- --- ACKNOWLEDGMENT Tue Mar 3 16:48:00 1992
- ***************
- *** 9,22 ****
- MSC and Mac ports and wrote .bat files for the tests.
- Another or maybe the same reviewer did the Dynix port.
-
- ! Layne Lommen ported mawk to the ApolloSR10.3.
-
- - Ed Ferguson ported mawk to MIPS M2000 C 2.20 (4.52).
- -
- - Jwahar R. Bammi ported mawk to AtariST.
- -
- The DOS version is a lot better thanks to suggestions and testing
- ! from Ed Ferguson, Jack Fitts, Nadav Horesh and Michael Golan.
-
- Arnold Robbins kept me current on POSIX standards for AWK, and
- explained some of the "dark corners".
- --- 9,28 ----
- MSC and Mac ports and wrote .bat files for the tests.
- Another or maybe the same reviewer did the Dynix port.
-
- ! Ports to new systems:
- ! Layne Lommen ApolloSR10.3
- ! Ed Ferguson MIPS M2000 C2.20 OS4.52
- ! Jwahar R. Bammi Atari ST
- ! Berry Kercheval SGI IRIX 4.0.1
- ! Andy Mason Next 2.1
- ! Mike Carlton Next 2.1
- ! Elliot Jaffe AIX 3.1
-
- The DOS version is a lot better thanks to suggestions and testing
- ! from Ed Ferguson, Jack Fitts, Nadav Horesh, Michael Golan and
- ! Conny Ohstrom.
-
- Arnold Robbins kept me current on POSIX standards for AWK, and
- explained some of the "dark corners".
- +
- +
- *** /tmp/,RCSt1a12426 Tue Mar 3 17:14:41 1992
- --- UCONFIG Tue Mar 3 16:45:58 1992
- ***************
- *** 29,34 ****
- --- 29,37 ----
- apolloSR10.3
- dynix
- mips
- + next cc is gcc
- + sgi
- + aix
-
- atarist cross compile with gcc
-
- ***************
- *** 98,102 ****
- --- 101,113 ----
- mips
- MIPS M2000 C 2.20 (4.52)
-
- + next
- + Next OS 2.1
- +
- + sgi
- + IRIX 4.0.1
- +
- + aix
- + RS/6000 running AIX 3.1
- atarist
- atari ST/StE/TT series with gcc
- *** /tmp/,RCSt1a12429 Tue Mar 3 17:14:43 1992
- --- build_mawk Tue Mar 3 16:46:00 1992
- ***************
- *** 10,15 ****
- --- 10,16 ----
- # build_mawk MF -- to get a generic Makefile
- #
-
- +
- progname=`basename $0`
-
-
- ***************
- *** 23,29 ****
- exit 1
- fi
-
- ! config=$1
- shift
-
- [ $# != 0 ] && eval "$@"
- --- 24,30 ----
- exit 1
- fi
-
- ! arg1=$1
- shift
-
- [ $# != 0 ] && eval "$@"
- ***************
- *** 32,38 ****
- [ "$CC" = "" ] && CC=cc
-
-
- ! case $config in
-
-
- sun_os40)
- --- 33,39 ----
- [ "$CC" = "" ] && CC=cc
-
-
- ! case $arg1 in
-
-
- sun_os40)
- ***************
- *** 61,67 ****
- config=generic.h ;;
-
- ultrix42_mips)
- ! config=ultrix42_mips.h
- cflags='-O -Olimit 700' ;;
-
- ultrix41_vax)
- --- 62,68 ----
- config=generic.h ;;
-
- ultrix42_mips)
- ! config=ultrix42mips.h
- cflags='-O -Olimit 700' ;;
-
- ultrix41_vax)
- ***************
- *** 104,114 ****
-
- mips)
- config=mips.h
- ! cflags='-O -systype bsd43' ;;
-
- MF) ;;
-
- ! *) echo "$progname: $1: unrecognized configuration" 1>&2
- exit 1 ;;
- esac
-
- --- 105,126 ----
-
- mips)
- config=mips.h
- ! cflags='-O -Olimit 700 -systype bsd43' ;;
-
- + sgi)
- + config=sgi.h
- + cflags='-O -cckr -w' ;;
- +
- + next)
- + config=next.h ;;
- +
- + aix)
- + config=generic.h ;;
- +
- +
- MF) ;;
-
- ! *) echo "$progname: $arg1: unrecognized configuration" 1>&2
- exit 1 ;;
- esac
-
- ***************
- *** 117,127 ****
- [ "$ar" = "" ] && ar=ar
- [ "$mathlib" = "" ] && mathlib=-lm
-
- echo generating a Makefile
-
- (
- echo "# This Makefile was generated by"
- ! echo '#'" $0 $config $*"
- sed -e 1,5d \
- -e "s/%CC%/$CC/" \
- -e "s/%CFLAGS%/$cflags/" \
- --- 129,148 ----
- [ "$ar" = "" ] && ar=ar
- [ "$mathlib" = "" ] && mathlib=-lm
-
- + # set CFLAGS for gcc
- + if [ $CC = gcc ]
- + then #determine gcc version
- + if gcc -v 2>&1 | egrep 'version 2' >/dev/null
- + then cflags=-O2
- + else cflags=-O
- + fi
- + fi
- +
- echo generating a Makefile
-
- (
- echo "# This Makefile was generated by"
- ! echo '#'" $0 $arg1 $*"
- sed -e 1,5d \
- -e "s/%CC%/$CC/" \
- -e "s/%CFLAGS%/$cflags/" \
- ***************
- *** 140,147 ****
- # it should exist
- [ -f parse.c ] && { echo touching parse.c ; touch parse.c ; }
-
- echo make -f Makefile
- make -f Makefile
- -
-
-
- --- 161,181 ----
- # it should exist
- [ -f parse.c ] && { echo touching parse.c ; touch parse.c ; }
-
- + echo 'ready to run: make -f Makefile'
- + # echo without newline differs from system to system
- + awk 'BEGIN{
- + printf "do you want to check or edit the Makefile first? [n] "
- + }' < /dev/null # some old awks need the /dev/null
- +
- + read answer
- + case "$answer" in
- + [yY]*) echo
- + echo 'To restart run: make -f Makefile'
- + echo
- + exit 0 ;;
- + esac
- +
- echo make -f Makefile
- make -f Makefile
-
-
- *** /tmp/,RCSt1a12432 Tue Mar 3 17:14:46 1992
- --- Makefile.in Tue Mar 3 16:59:30 1992
- ***************
- *** 92,97 ****
- --- 92,98 ----
-
- scancode.c : makescan.c scan.h
- $(CC) -o makescan.exe makescan.c
- + rm -f scancode.c
- ./makescan.exe > scancode.c
- rm makescan.exe
-
- *** /tmp/,RCSt1a12435 Tue Mar 3 17:14:48 1992
- --- fin.c Fri Feb 21 13:30:50 1992
- ***************
- *** 11,16 ****
- --- 11,20 ----
- ********************************************/
-
- /*$Log: fin.c,v $
- + * Revision 5.2 92/02/21 13:30:08 brennan
- + * fixed bug that free'd FILENAME twice if
- + * command line was var=value only
- + *
- * Revision 5.1 91/12/05 07:56:02 brennan
- * 1.1 pre-release
- *
- ***************
- *** 370,375 ****
- --- 374,381 ----
-
- if ( main_fin ) FINclose(main_fin) ;
- cell_destroy( FILENAME ) ;
- + FILENAME->type = C_NOINIT ;
- + /* so don't free again if we go to set_main_to_stdin() */
- cell_destroy( FNR ) ;
- FNR->type = C_DOUBLE ;
- FNR->dval = 0.0 ;
- ***************
- *** 396,402 ****
-
- /* try to open it -- we used to continue on failure,
- but posix says we should quit */
- ! if ( ! (main_fin = FINopen( string(cp)->str, 1 )) ) exit(1) ;
-
- /* success */
- (void) cellcpy(FILENAME , cp ) ;
- --- 402,408 ----
-
- /* try to open it -- we used to continue on failure,
- but posix says we should quit */
- ! if ( ! (main_fin = FINopen( string(cp)->str, 1 )) ) mawk_exit(1) ;
-
- /* success */
- (void) cellcpy(FILENAME , cp ) ;
- ***************
- *** 456,461 ****
- --- 462,468 ----
- case ST_VAR :
- case ST_NR : /* !! no one will do this */
- cp = stp->stval.cp ;
- + cell_destroy(cp) ;
- break ;
-
- case ST_FIELD :
- ***************
- *** 477,483 ****
- p = rm_escape( strcpy((char*)zmalloc(len), p) ) ;
- cp->ptr = (PTR) new_STRING(p) ;
- zfree(p,len) ;
- ! check_strnum(cp) ;
- if ( fp ) /* move it from cell to pfield[] */
- { field_assign(fp, cp) ; free_STRING(string(cp)) ; }
- return 1 ;
- --- 484,490 ----
- p = rm_escape( strcpy((char*)zmalloc(len), p) ) ;
- cp->ptr = (PTR) new_STRING(p) ;
- zfree(p,len) ;
- ! check_strnum(cp) ; /* sets cp->type */
- if ( fp ) /* move it from cell to pfield[] */
- { field_assign(fp, cp) ; free_STRING(string(cp)) ; }
- return 1 ;
- *** /tmp/,RCSt1a12438 Tue Mar 3 17:14:50 1992
- --- mawk.h Tue Mar 3 16:34:56 1992
- ***************
- *** 12,17 ****
- --- 12,20 ----
-
-
- /* $Log: mawk.h,v $
- + * Revision 5.4 92/03/03 16:34:41 brennan
- + * conditional around open() proto
- + *
- * Revision 5.3 92/01/09 08:46:58 brennan
- * cell destroy macro
- *
- ***************
- *** 146,156 ****
- --- 149,168 ----
- int PROTO( binmode, (void)) ;
-
- void PROTO( exit, (int) ) ;
- +
- #ifdef THINK_C
- #include <unix.h>
- #else
- int PROTO( close, (int) ) ;
- +
- + /* ANSI compilers won't like open() if they've ever seen open as
- + int open(char *,int, ...). If so remove it.
- + */
- +
- + #ifndef _IBMR2 /* AIX */
- int PROTO( open, (char *,int, int) ) ;
- + #endif
- +
- int PROTO( read, (int , PTR, unsigned) ) ;
- #endif
-
- *** /tmp/,RCSt1a12441 Tue Mar 3 17:14:52 1992
- --- patchlev.h Tue Mar 3 16:42:33 1992
- ***************
- *** 1,3 ****
- /* mawk 1.1 */
- ! #define PATCHLEVEL 0
- ! #define PATCH_STRING ""
- --- 1,3 ----
- /* mawk 1.1 */
- ! #define PATCHLEVEL 1
- ! #define PATCH_STRING ".1"
- *** /tmp/,RCSt1a12444 Tue Mar 3 17:14:54 1992
- --- print.c Mon Feb 24 10:53:13 1992
- ***************
- *** 1,7 ****
-
- /********************************************
- print.c
- ! copyright 1991, Michael D. Brennan
-
- This is a source file for mawk, an implementation of
- the AWK programming language.
- --- 1,7 ----
-
- /********************************************
- print.c
- ! copyright 1992, 1991. Michael D. Brennan
-
- This is a source file for mawk, an implementation of
- the AWK programming language.
- ***************
- *** 11,16 ****
- --- 11,20 ----
- ********************************************/
-
- /* $Log: print.c,v $
- + * Revision 5.2 92/02/24 10:52:16 brennan
- + * printf and sprintf() can now have more args than % conversions
- + * removed HAVE_PRINTF_HD -- it was too obscure
- + *
- * Revision 5.1 91/12/05 07:56:22 brennan
- * 1.1 pre-release
- *
- ***************
- *** 26,32 ****
-
- static void PROTO( print_cell, (CELL *, FILE *) ) ;
- static STRING* PROTO( do_printf, (FILE *, char *, unsigned, CELL *) ) ;
- - static void PROTO( arg_error, (char *, char *, char *) ) ;
- static void PROTO( bad_conversion, (int, char *, char *)) ;
-
-
- --- 30,35 ----
- ***************
- *** 130,142 ****
-
- /*-------------------------------------------------------*/
-
- - static void arg_error( few_or_many, who, format)
- - char *few_or_many , *who, *format ;
- - {
- - rt_error("too %s arguments passed to %s(\"%s\")",
- - few_or_many, who, format) ;
- - }
- -
- static void bad_conversion(cnt, who, format)
- int cnt ;
- char *who , *format ;
- --- 133,138 ----
- ***************
- *** 185,204 ****
-
- while ( 1 )
- {
- ! if ( fp )
- {
- while ( *q != '%' )
- ! if ( *q == 0 )
- ! if ( argcnt == 0 ) return (STRING *) 0 ;
- ! else arg_error("many", who, format) ;
- else
- { putc(*q,fp) ; q++ ; }
- }
- ! else
- {
- while ( *q != '%' )
- if ( *q == 0 )
- ! if ( argcnt == 0 ) /* done */
- if ( target > sprintf_limit ) /* damaged */
- {
- /* hope this works */
- --- 181,198 ----
-
- while ( 1 )
- {
- ! if ( fp ) /* printf */
- {
- while ( *q != '%' )
- ! if ( *q == 0 ) return (STRING *) 0 ;
- else
- { putc(*q,fp) ; q++ ; }
- }
- ! else /* sprintf */
- {
- while ( *q != '%' )
- if ( *q == 0 )
- ! {
- if ( target > sprintf_limit ) /* damaged */
- {
- /* hope this works */
- ***************
- *** 214,220 ****
- (void)memcpy(retval->str, sprintf_buff, SIZE_T(len)) ;
- return retval ;
- }
- ! else arg_error("many", who, format) ;
- else *target++ = *q++ ;
- }
-
- --- 208,214 ----
- (void)memcpy(retval->str, sprintf_buff, SIZE_T(len)) ;
- return retval ;
- }
- ! }
- else *target++ = *q++ ;
- }
-
- ***************
- *** 259,273 ****
- while ( scan_code[*(unsigned char*)q] == SC_DIGIT ) q++ ;
- }
-
- ! if ( argcnt <= 0 ) arg_error("few", who, format) ;
- l_flag = h_flag = 0 ;
-
- if ( *q == 'l' ) { q++ ; l_flag = 1 ; }
- -
- - #if HAVE_PRINTF_HD
- else
- if ( *q == 'h' ) { q++ ; h_flag = 1 ; }
- - #endif
-
- switch( *q++ )
- {
- --- 253,267 ----
- while ( scan_code[*(unsigned char*)q] == SC_DIGIT ) q++ ;
- }
-
- ! if ( argcnt <= 0 )
- ! rt_error("not enough arguments passed to %s(\"%s\")",
- ! who, format) ;
- !
- l_flag = h_flag = 0 ;
-
- if ( *q == 'l' ) { q++ ; l_flag = 1 ; }
- else
- if ( *q == 'h' ) { q++ ; h_flag = 1 ; }
-
- switch( *q++ )
- {
- ***************
- *** 318,326 ****
- case 'u' :
- if ( cp->type != C_DOUBLE ) cast1_to_d(cp) ;
- lval = (long) cp->dval ;
- - #if HAVE_PRINTF_HD
- if ( h_flag ) lval &= 0xffff ;
- ! #endif
- pf_type = l_flag ? PF_LD : PF_D ;
- break ;
-
- --- 312,319 ----
- case 'u' :
- if ( cp->type != C_DOUBLE ) cast1_to_d(cp) ;
- lval = (long) cp->dval ;
- if ( h_flag ) lval &= 0xffff ;
- !
- pf_type = l_flag ? PF_LD : PF_D ;
- break ;
-
- *** /tmp/,RCSt1a12447 Tue Mar 3 17:14:57 1992
- --- scan.c Fri Feb 21 14:16:58 1992
- ***************
- *** 12,17 ****
- --- 12,20 ----
-
-
- /* $Log: scan.c,v $
- + * Revision 5.2 92/02/21 14:16:53 brennan
- + * fix: getline <=
- + *
- * Revision 5.1 91/12/05 07:56:27 brennan
- * 1.1 pre-release
- *
- ***************
- *** 354,363 ****
-
-
- case SC_LT : /* '<' */
- if ( getline_flag )
- { getline_flag = 0 ; ct_ret(IO_IN) ; }
- ! else
- ! test1_ret('=', LTE, LT) ;
-
- case SC_GT : /* '>' */
- if ( print_flag && paren_cnt == 0 )
- --- 357,368 ----
-
-
- case SC_LT : /* '<' */
- + if ( next() == '=' ) ct_ret(LTE) ;
- + else un_next() ;
- +
- if ( getline_flag )
- { getline_flag = 0 ; ct_ret(IO_IN) ; }
- ! else ct_ret(LT) ;
-
- case SC_GT : /* '>' */
- if ( print_flag && paren_cnt == 0 )
- *** /tmp/,RCSt1a12450 Tue Mar 3 17:15:00 1992
- --- version.c Tue Mar 3 16:42:30 1992
- ***************
- *** 11,16 ****
- --- 11,19 ----
- ********************************************/
-
- /*$Log: version.c,v $
- + * Revision 5.3 92/03/03 16:42:23 brennan
- + * patch 1
- + *
- * Revision 5.2 92/01/22 05:34:10 brennan
- * version 1.1
- *
- ***************
- *** 23,29 ****
- #include "patchlev.h"
-
- #define VERSION_STRING \
- ! "mawk 1.1%s%s Dec 1991, Copyright (C) Michael D. Brennan\n\n"
-
- #define DOS_STRING ""
-
- --- 26,32 ----
- #include "patchlev.h"
-
- #define VERSION_STRING \
- ! "mawk 1.1%s%s Feb 1992, Copyright (C) Michael D. Brennan\n\n"
-
- #define DOS_STRING ""
-
- *** /tmp/,RCSt1a12453 Tue Mar 3 17:15:01 1992
- --- rexp/rexp1.c Fri Feb 21 11:55:18 1992
- ***************
- *** 11,16 ****
- --- 11,19 ----
- ********************************************/
-
- /*$Log: rexp1.c,v $
- + * Revision 3.4 92/02/20 16:08:12 brennan
- + * change new_TWO() to work around sun acc bug
- + *
- * Revision 3.3 91/10/29 10:54:01 brennan
- * SIZE_T
- *
- ***************
- *** 26,80 ****
-
- #include "rexp.h"
-
- ! static MACHINE *PROTO( new_TWO , (int) ) ;
-
-
- ! static MACHINE *new_TWO(type)
- int type ;
- {
- ! static MACHINE x ;
-
- - x.start = (STATE *) RE_malloc(2*STATESZ) ;
- - x.stop = x.start + 1 ;
- - x.start->type = type ;
- - x.stop->type = M_ACCEPT ;
- - return &x ;
- - } ;
- -
- -
- /* build a machine that recognizes any */
- MACHINE RE_any()
- ! { return * new_TWO(M_ANY) ; }
-
- /* build a machine that recognizes the start of string */
- MACHINE RE_start()
- ! { return * new_TWO(M_START) ; }
-
- MACHINE RE_end()
- ! { return * new_TWO(M_END) ; }
-
- /* build a machine that recognizes a class */
- MACHINE RE_class( bvp )
- BV *bvp ;
- ! { register MACHINE *p = new_TWO(M_CLASS) ;
-
- ! p->start->data.bvp = bvp ;
- ! return *p ;
- }
-
- -
- MACHINE RE_u()
- ! { return *new_TWO(M_U) ; }
-
- MACHINE RE_str( str, len)
- char *str ;
- unsigned len ;
- ! { register MACHINE *p = new_TWO(M_STR) ;
-
- ! p->start->len = len ;
- ! p->start->data.str = str ;
- ! return *p ;
- }
-
- /* replace m and n by a machine that recognizes mn */
- void RE_cat( mp, np)
- --- 29,106 ----
-
- #include "rexp.h"
-
- ! static void PROTO( new_TWO , (int, MACHINE *) ) ;
-
-
- !
- ! /* initialize a two state machine */
- ! static void new_TWO(type, mp)
- int type ;
- + MACHINE *mp ; /* init mp-> */
- {
- ! mp->start = (STATE *) RE_malloc(2*STATESZ) ;
- ! mp->stop = mp->start + 1 ;
- ! mp->start->type = type ;
- ! mp->stop->type = M_ACCEPT ;
- ! }
-
- /* build a machine that recognizes any */
- MACHINE RE_any()
- ! {
- ! MACHINE x ;
-
- + new_TWO(M_ANY, &x) ;
- + return x ;
- + }
- +
- /* build a machine that recognizes the start of string */
- MACHINE RE_start()
- ! {
- ! MACHINE x ;
-
- + new_TWO(M_START, &x) ;
- + return x ;
- + }
- +
- MACHINE RE_end()
- ! {
- ! MACHINE x ;
-
- + new_TWO(M_END, &x) ;
- + return x ;
- + }
- +
- /* build a machine that recognizes a class */
- MACHINE RE_class( bvp )
- BV *bvp ;
- ! {
- ! MACHINE x ;
-
- ! new_TWO(M_CLASS, &x) ;
- ! x.start->data.bvp = bvp ;
- ! return x ;
- }
-
- MACHINE RE_u()
- ! {
- ! MACHINE x ;
-
- + new_TWO(M_U, &x) ;
- + return x ;
- + }
- +
- MACHINE RE_str( str, len)
- char *str ;
- unsigned len ;
- ! {
- ! MACHINE x ;
-
- ! new_TWO(M_STR, &x) ;
- ! x.start->len = len ;
- ! x.start->data.str = str ;
- ! return x ;
- }
- +
-
- /* replace m and n by a machine that recognizes mn */
- void RE_cat( mp, np)
- *** /tmp/,RCSt1a12456 Tue Mar 3 17:15:03 1992
- --- config/generic.h Tue Mar 3 16:40:55 1992
- ***************
- *** 1,7 ****
-
- /********************************************
- generic.h
- ! copyright 1991, Michael D. Brennan
-
- This is a source file for mawk, an implementation of
- the AWK programming language.
- --- 1,7 ----
-
- /********************************************
- generic.h
- ! copyright 1991, 1992. Michael D. Brennan
-
- This is a source file for mawk, an implementation of
- the AWK programming language.
- ***************
- *** 12,17 ****
- --- 12,20 ----
-
-
- /* $Log: generic.h,v $
- + * Revision 4.4 92/03/03 16:40:54 brennan
- + * remove HAVE_PRINTF_HD
- + *
- * Revision 4.3 91/10/29 10:48:26 brennan
- * version 1.09
- *
- ***************
- *** 50,57 ****
- have matherr()
- have strtod()
- have fmod()
- -
- - printf and sprintf cannot handle "%hd"
-
-
- divison by zero, overflow and library domain errors do not
- --- 53,58 ----
- *** /tmp/,RCSt1a12459 Tue Mar 3 17:15:05 1992
- --- config/Idefault.h Tue Mar 3 16:40:58 1992
- ***************
- *** 1,7 ****
-
- /********************************************
- Idefault.h
- ! copyright 1991, Michael D. Brennan
-
- This is a source file for mawk, an implementation of
- the AWK programming language.
- --- 1,7 ----
-
- /********************************************
- Idefault.h
- ! copyright 1991, 1992. Michael D. Brennan
-
- This is a source file for mawk, an implementation of
- the AWK programming language.
- ***************
- *** 12,17 ****
- --- 12,20 ----
-
-
- /* $Log: Idefault.h,v $
- + * Revision 3.13 92/03/03 16:40:56 brennan
- + * remove HAVE_PRINTF_HD
- + *
- * Revision 3.12 91/11/16 15:37:29 brennan
- * add NO_BINMODE
- *
- ***************
- *** 131,141 ****
-
- #ifndef HAVE_FCNTL_H
- #define HAVE_FCNTL_H 1
- - #endif
- -
- - /* printf and sprintf don't recognize "%hd" */
- - #ifndef HAVE_PRINTF_HD
- - #define HAVE_PRINTF_HD 0
- #endif
-
- /* have pipes */
- --- 134,139 ----
- *** /dev/null Tue Mar 3 12:53:03 1992
- --- config/ultrix42mips.h Tue Mar 3 12:35:23 1992
- ***************
- *** 0 ****
- --- 1,32 ----
- +
- + /********************************************
- + ultrix42mips.h
- + copyright 1992, Michael D. Brennan
- +
- + This is a source file for mawk, an implementation of
- + the AWK programming language.
- +
- + Mawk is distributed without warranty under the terms of
- + the GNU General Public License, version 2, 1991.
- + ********************************************/
- +
- +
- + /* $Log: ultrix42mips.h,v $
- + * Revision 1.1 92/03/03 12:35:21 brennan
- + * Initial revision
- + *
- + */
- +
- +
- + #ifndef CONFIG_H
- + #define CONFIG_H 1
- +
- + #define HAVE_PROTOS 1
- + #define HAVE_STDLIB_H 1
- + #define HAVE_STDARG_H 1
- +
- + /* The only reason __STDC__ is not turned on is
- + compiler doesn't recognize const */
- +
- + #include "config/Idefault.h"
- + #endif /* CONFIG_H */
- *** /dev/null Tue Mar 3 12:53:03 1992
- --- config/next.h Tue Feb 25 08:13:14 1992
- ***************
- *** 0 ****
- --- 1,31 ----
- +
- + /********************************************
- + next.h
- +
- + This is a source file for mawk, an implementation of
- + the AWK programming language.
- +
- + Mawk is distributed without warranty under the terms of
- + the GNU General Public License, version 2, 1991.
- + ********************************************/
- +
- + /*
- + Next OS 2.1
- + */
- +
- + /* $Log: next.h,v $
- + * Revision 1.1 92/02/25 08:13:12 brennan
- + * Initial revision
- + *
- + */
- +
- + #ifndef CONFIG_H
- + #define CONFIG_H 1
- +
- + /* system compiler is gcc and has <stdlib.h> */
- + #define HAVE_STDLIB_H 1
- +
- + #include "config/Idefault.h"
- +
- + #endif
- +
- *** /dev/null Tue Mar 3 12:53:03 1992
- --- config/sgi.h Tue Feb 25 08:10:24 1992
- ***************
- *** 0 ****
- --- 1,30 ----
- +
- + /********************************************
- + sgi.h
- +
- + This is a source file for mawk, an implementation of
- + the AWK programming language.
- +
- + Mawk is distributed without warranty under the terms of
- + the GNU General Public License, version 2, 1991.
- + ********************************************/
- +
- + /*
- + SGI IRIX4.0.1
- + */
- +
- + /* $Log: sgi.h,v $
- + * Revision 1.1 92/02/25 08:10:22 brennan
- + * Initial revision
- + *
- + */
- +
- + #ifndef CONFIG_H
- + #define CONFIG_H 1
- +
- + #define HAVE_STRTOD 0
- +
- + #include "config/Idefault.h"
- +
- + #endif
- +
- *** /dev/null Tue Mar 3 12:53:03 1992
- --- config/apollo.h Wed Sep 25 11:41:07 1991
- ***************
- *** 0 ****
- --- 1,32 ----
- +
- + /********************************************
- + apollo.h
- + copyright 1991, Michael D. Brennan
- +
- + This is a source file for mawk, an implementation of
- + the AWK programming language.
- +
- + Mawk is distributed without warranty under the terms of
- + the GNU General Public License, version 2, 1991.
- + ********************************************/
- +
- + /*
- + compiled and tested on apollo SR10.3
- + */
- +
- + #ifndef CONFIG_H
- + #define CONFIG_H 1
- +
- + /* don't have IEEE hardware */
- + #define FPE_TRAPS_ON 1
- + #define FPE_ZERODIVIDE FPE_FLTDIV_FAULT
- + #define FPE_OVERFLOW FPE_FLTOVF_FAULT
- +
- + /* compiler sets __STDC__ but really is not ansi */
- + #undef __STDC__
- +
- + #include "config/Idefault.h"
- +
- +
- + #endif /* CONFIG_H */
- +
- *** /tmp/,RCSt1a12466 Tue Mar 3 17:15:09 1992
- --- test/mawktest.bat Tue Feb 25 08:35:48 1992
- ***************
- *** 47,49 ****
- --- 47,50 ----
- echo if fc always encountered "no differences", then the tested mawk seems OK
- :done
- del temp$$
- + set dat=
- @//E*O*F diffs1//
- chmod u=r,g=r,o=r diffs1
-
- exit 0
-
-
-
- exit 0 # Just in case...
-